<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>个人社保计算软件-192023304胡俊杰</title>
		<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
				<script src="https://cdn.staticfile.org/twitter-
				bootstrap/3.3.7/js/bootstrap.min.js"></script>
				<link href="https://cdn.staticfile.org/twitter-
				bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
				<script>
					function calc(){
						//1.取得用户输入的工资
						sal = $("#salary").val();//"10000"
						salnum = parseInt(sal);
						ylgr = salnum*0.08;
						ylgs = salnum*0.2;
						$("#ylgr").text(ylgr);
						$("#ylgs").text(ylgs);
						
						yiliaogr = salnum*0.02;
						yiliaogs = salnum*0.06;
						$("#yiliaogr").text(yiliaogr);
						$("#yiliaogs").text(yiliaogs);
						
						sygr = salnum*0.005;
						sygs = salnum*0.015;
						$("#sygr").text(sygr);
						$("#sygs").text(sygs);
						
						gsgs = salnum*0.005;
						$("#gsgs").text(gsgs);
						
						shengyugs = salnum*0.008;
						$("#shengyugs").text(shengyugs);
						
						gjjgr = salnum*0.12;
						gjjgs = salnum*0.12;
						$("#gjjgr").text(gjjgr);
						$("#gjjgs").text(gjjgs);
						
						hjgr = ylgr + yiliaogr + sygr + gjjgr;
						hjgs = ylgs + yiliaogs + sygs + gsgs + shengyugs + gjjgs;
						$("#hjgr").text(hjgr);
						$("#hjgs").text(hjgs);
						
						zezz = hjgr + hjgs;
						$("#zezz").text(zezz);
						
						
					}
				</script>
	</head>
	<body>
		<div class="container text-center">
			<h3>个人社保计算软件</h3>
			<table class="table table-bordered text-center">
				<tr>
					<td>工资</td>
					<td colspan="3">
						<input class="form-control" type="text" id="salary" placeholder="请输入工资">
					</td>
					<td>
						<button onclick="calc()" class="btn btn-danger btn-block">计算</button>
					</td>
				</tr>
				<tr class="bg-primary">
					<td>险种</td>
					<td>个人%</td>
					<td>个人</td>
					<td>公司%</td>
					<td>公司</td>
				</tr>
				<tr>
					<td>养老</td>
					<td>8%</td>
					<td id = "ylgr"></td>
					<td>20%</td>
					<td id = "ylgs"></td>
				</tr>
				<tr>
					<td>医疗</td>
					<td>2%</td>
					<td id = "yiliaogr"></td>
					<td>6%</td>
					<td id = "yiliaogs"></td>
				</tr>
				<tr>
					<td>失业</td>
					<td>0.5%</td>
					<td id = "sygr"></td>
					<td>1.5%</td>
					<td id = "sygs"></td>
				</tr>
				<tr>
					<td>工伤</td>
					<td></td>
					<td></td>
					<td>0.5%</td>
					<td id = "gsgs"></td>
				</tr>
				<tr>
					<td>生育</td>
					<td></td>
					<td></td>
					<td>0.8%</td>
					<td id = "shengyugs"></td>
				</tr>
				<tr>
					<td>公积金</td>
					<td>12%</td>
					<td id = "gjjgr"></td>
					<td>12%</td>
					<td id = "gjjgs"></td>
				</tr>
				<tr>
					<td>合计</td>
					<td>个人合计</td>
					<td id = "hjgr"></td>
					<td>公司合计</td>
					<td id = "hjgs"></td>
				</tr>
				<tr>
					<td >总额</td>
					<td  id = "zezz" colspan="4" >
					</td>
				</tr>
			</table>
			开发者：电子工程系 192023304  胡俊杰
		</div>
		
	</body>
</html>
